package br.com.gaspar.academia.mb;


import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import br.com.gaspar.academia.bo.iface.IProjetoBO;
import br.com.gaspar.academia.modelo.Aluno;
import br.com.gaspar.framework.visao.jsf.ManagedBeanBase;
import br.com.gaspar.utils.exception.BaseException;

@ManagedBean(name="AlunoMB")
@ViewScoped
public class AlunoMB extends ManagedBeanBase<Aluno> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@EJB
	private IProjetoBO<Aluno> bo;
	
	@Override
	protected IProjetoBO<Aluno> getFachada() {
		return bo;
	}
	
	@PostConstruct
	@Override
	public void iniciar() {
		setEntidade(new Aluno());
		super.iniciar();
	}
	
	@Override
	protected void criarAntes() throws BaseException {
		setEntidade(new Aluno());
		super.criarAntes();
	}
}
